package cn.hehuoren.quartz.model;


import cn.hehuoren.core.utils.DateUtil;

import java.io.Serializable;


/**
 * 调度任务执行日志
 * 
 * @author ZhouMin
 */
public class QrtzJobRunLog implements Serializable {
	private static final long serialVersionUID = 1L;
	private String id;
	private String jobName;
	private String jobGroup;
	private String description;
	private String jobJsonObject;
	private java.sql.Timestamp runStartTime;
	private java.sql.Timestamp runEndTime;
	private String runStartTimeStr;
	private String runEndTimeStr;
	private Long runUsedTime;
	private String runResultCode;
	private String runResultDesc;
	private String fireInstanceId;
	private String runResultCodeDict;

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getJobName() {
		return this.jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public String getJobGroup() {
		return this.jobGroup;
	}

	public void setJobGroup(String jobGroup) {
		this.jobGroup = jobGroup;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getJobJsonObject() {
		return this.jobJsonObject;
	}

	public void setJobJsonObject(String jobJsonObject) {
		this.jobJsonObject = jobJsonObject;
	}

	public java.sql.Timestamp getRunStartTime() {
		return this.runStartTime;
	}

	public void setRunStartTime(java.sql.Timestamp runStartTime) {
		this.runStartTime = runStartTime;
	}

	public java.sql.Timestamp getRunEndTime() {
		return this.runEndTime;
	}

	public void setRunEndTime(java.sql.Timestamp runEndTime) {
		this.runEndTime = runEndTime;
	}

	public Long getRunUsedTime() {
		return this.runUsedTime;
	}

	public void setRunUsedTime(Long runUsedTime) {
		this.runUsedTime = runUsedTime;
	}

	public String getRunResultCode() {
		return this.runResultCode;
	}

	public void setRunResultCode(String runResultCode) {
		this.runResultCode = runResultCode;
	}

	public String getRunResultDesc() {
		return this.runResultDesc;
	}

	public void setRunResultDesc(String runResultDesc) {
		this.runResultDesc = runResultDesc;
	}

	public String getFireInstanceId() {
		return fireInstanceId;
	}

	public void setFireInstanceId(String fireInstanceId) {
		this.fireInstanceId = fireInstanceId;
	}

	public String getFireInstanceIdDesc() {
		if (null != fireInstanceId) {
			fireInstanceId = fireInstanceId.replaceAll("13.*", "");
		}
		return fireInstanceId;
	}

	public String getRunResultCodeDict() {
		if ("0000".equals(this.runResultCode)) {
			runResultCodeDict = "正常";
		} else {
			runResultCodeDict = "异常";
		}
		return this.runResultCodeDict;
	}

	public String getRunStartTimeStr() {
		return DateUtil.format(this.runStartTime);
	}

	public void setRunStartTimeStr(String runStartTimeStr) {
		this.runStartTimeStr = runStartTimeStr;
	}

	public String getRunEndTimeStr() {
		return DateUtil.format(this.runEndTime);
	}

	public void setRunEndTimeStr(String runEndTimeStr) {
		this.runEndTimeStr = runEndTimeStr;
	}

	public void setRunResultCodeDict(String runResultCodeDict) {
		this.runResultCodeDict = runResultCodeDict;
	}
}
